package com.example.blogdemo.common.Utils;

import com.example.blogdemo.pojo.dataobject.BlogInfo;
import com.example.blogdemo.pojo.dataobject.UserInfo;
import com.example.blogdemo.pojo.respond.BlogRespond;
import com.example.blogdemo.pojo.respond.BlogRespondOne;
import com.example.blogdemo.pojo.respond.GetUserInfo;
import jakarta.validation.constraints.NotNull;
import org.springframework.beans.BeanUtils;

public class BlogBeanUtils {
    public static BlogRespond transResponds(@NotNull BlogInfo blogInfo) {

        BlogRespond blogRespond = new BlogRespond();
        BeanUtils.copyProperties(blogInfo, blogRespond);
        return blogRespond;
    }

    public static BlogRespondOne transOne(@NotNull BlogInfo blogInfo) {
        BlogRespondOne blogRespond = new BlogRespondOne();
        BeanUtils.copyProperties(blogInfo, blogRespond);
        return blogRespond;
    }

    public static GetUserInfo transUser(@NotNull UserInfo userInfo) {
        GetUserInfo getUserInfo = new GetUserInfo();
        BeanUtils.copyProperties(userInfo, getUserInfo);
        return getUserInfo;
    }
}
